home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5362 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: solon.com!not-for-mail
  2. From: seebs@solutions.solon.com (Peter Seebach)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Limit on #bytes inside of struct?
  5. Date: 12 Feb 1996 08:02:32 -0600
  6. Organization: Usenet Fact Police (Undercover)
  7. Message-ID: <4fnh9o$9q1@solutions.solon.com>
  8. References: <4feg1d$d4g@cville-srv.wam.umd.edu> <4ffohq$1gb@mordred.gatech.edu> <4ffun7$1l4l@cymbal.aix.calpoly.edu> <311F15D8.78D1@zess.uni-siegen.de>
  9. NNTP-Posting-Host: solutions.solon.com
  10.  
  11. In article <311F15D8.78D1@zess.uni-siegen.de>,
  12. Markus Becker  <becker@zess.uni-siegen.de> wrote:
  13. >No it isn't, see below.
  14.  
  15. >>    typedef struct {
  16. >>       int the_array[50000];
  17. >>    } struct_type;
  18.  
  19. >This way, you don't put the 50K numbers in the struct, but only
  20. >a pointer to them. Should be at most 4 bytes.
  21.  
  22. Please try not to post under the influence.
  23.  
  24. That code would create a type "struct_type" with size (50000 * sizeof(int))
  25. plus any optional padding.
  26.  
  27. Now,
  28.     void foo(int x[50000]) {
  29.     }
  30. takes as an argument only a pointer to an int, but this is much
  31. different.
  32.  
  33. -s
  34. -- 
  35. Peter Seebach - seebs@solon.com - Copyright 1995 Peter Seebach.
  36. C/Unix wizard -- C/Unix questions? Send mail for help.  No, really!
  37. FUCK the communications decency act.  Goddamned government.  [literally.]
  38. The *other* C FAQ - ftp taniemarie.solon.com /pub/c/afq - Not A Flying Toy
  39.